﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using QuanLiThuVien.Source;
using QuanLiThuVien.LinkModel;

namespace QuanLiThuVien
{
    /// <summary>
    /// Interaction logic for ThongTinDocGia.xaml
    /// </summary>
    public partial class ThongTinDocGia : Page
    {
        private string m_sMaDocGia;
        private THUVIEN.Service1 serv = new THUVIEN.Service1();
        private XuLyThem m_cXuLyThem = new XuLyThem();

        public ThongTinDocGia(string MaDocGia)
        {
            InitializeComponent();
            m_sMaDocGia = MaDocGia;
            if (m_cXuLyThem.IsDocGia(m_sMaDocGia))
                HienThongTinNguoiDung();
        }

        private void HienThongTinNguoiDung()
        {
            txtMaDocGia.Text = serv.SelectDocGia_MaDocGia(m_sMaDocGia).MaDocGia;
            txtHoTen.Text = serv.SelectDocGia_MaDocGia(m_sMaDocGia).HoTenDocGia;
            txtDiaChi.Text = serv.SelectDocGia_MaDocGia(m_sMaDocGia).DiaChi;
            txtEmail.Text = serv.SelectDocGia_MaDocGia(m_sMaDocGia).Email;
            txtLoaiDocGia.Text = serv.SelectDocGia_MaDocGia(m_sMaDocGia).TenLoaiDocGia;
            dtmNgaySinh_ThongTinDG.SelectedDate = serv.SelectDocGia_MaDocGia(m_sMaDocGia).NgaySinh;
            dtmNgayLapThe_ThongTinDG.SelectedDate = serv.SelectDocGia_MaDocGia(m_sMaDocGia).NgayLapThe;
            dtmNgayHetHan_ThongTinDG.SelectedDate = serv.SelectDocGia_MaDocGia(m_sMaDocGia).NgayHetHan;
            txtTienNo.Text = serv.SelectDocGia_MaDocGia(m_sMaDocGia).TienNo.ToString();
        }
    }
}
